import { Button } from 'antd'
import { useDrag } from 'react-dnd'

const PaletteItem = ({
  item,
  children
}) => {

  const [, drag] = useDrag({
    type: 'FORM_DESIGNER',
    item: {
      paletteItem: item,
      dragType: 'palette'
    }
  })

  return <Button
    ref={drag}
    size="small"
    block
  >{children}</Button>
}

export default PaletteItem